import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:jinke/utils/component/component.dart';
import 'package:jinke/utils/util.dart';

class NameField extends StatelessWidget {
  const NameField({
    super.key,
    required this.name,
    required this.placeholder,
    this.controller,
  });
  final String name;
  final String placeholder;
  final TextEditingController? controller;
  @override
  Widget build(BuildContext context) {
    return Container(
      child: UITextField(
        prefixIcon: Text.rich(
          TextSpan(
              text: '*',
              style: TextStyle(color: ColorsUtil.red, fontSize: 16.sp),
              children: [
                TextSpan(
                  text: name,
                  style: TextStyle(color: ColorsUtil.title, fontSize: 16.sp),
                )
              ]),
        ),
        textAlign: TextAlign.right,
        hintText: placeholder,
        controller: controller,
      ),
    );
  }
}
